<?php


abstract class BaseHistoria extends BaseObject  implements Persistent {


	
	protected static $peer;


	
	protected $id;


	
	protected $numhistoria;


	
	protected $fecha;


	
	protected $elaboradopor;


	
	protected $cedula;

	
	protected $aDatos;

	
	protected $collTabacos;

	
	protected $lastTabacoCriteria = null;

	
	protected $collAlcohols;

	
	protected $lastAlcoholCriteria = null;

	
	protected $collFisicas;

	
	protected $lastFisicaCriteria = null;

	
	protected $collRecreativass;

	
	protected $lastRecreativasCriteria = null;

	
	protected $collFunc_familias;

	
	protected $lastFunc_familiaCriteria = null;

	
	protected $collMujeress;

	
	protected $lastMujeresCriteria = null;

	
	protected $collHombress;

	
	protected $lastHombresCriteria = null;

	
	protected $collEnfermedadess;

	
	protected $lastEnfermedadesCriteria = null;

	
	protected $collAntecedentess;

	
	protected $lastAntecedentesCriteria = null;

	
	protected $collAntegineobss;

	
	protected $lastAntegineobsCriteria = null;

	
	protected $collExamfiss;

	
	protected $lastExamfisCriteria = null;

	
	protected $collInfante_pers;

	
	protected $lastInfante_perCriteria = null;

	
	protected $collAspec_saluds;

	
	protected $lastAspec_saludCriteria = null;

	
	protected $collEnf_nins;

	
	protected $lastEnf_ninCriteria = null;

	
	protected $collAlimenNins;

	
	protected $lastAlimenNinCriteria = null;

	
	protected $collEntrevistas;

	
	protected $lastEntrevistaCriteria = null;

	
	protected $collServicioss;

	
	protected $lastServiciosCriteria = null;

	
	protected $collSitsocioecons;

	
	protected $lastSitsocioeconCriteria = null;

	
	protected $collSitviviendas;

	
	protected $lastSitviviendaCriteria = null;

	
	protected $collUbc_geograficas;

	
	protected $lastUbc_geograficaCriteria = null;

	
	protected $alreadyInSave = false;

	
	protected $alreadyInValidation = false;

	
	public function getId()
	{

		return $this->id;
	}

	
	public function getNumhistoria()
	{

		return $this->numhistoria;
	}

	
	public function getFecha($format = 'Y-m-d')
	{

		if ($this->fecha === null || $this->fecha === '') {
			return null;
		} elseif (!is_int($this->fecha)) {
						$ts = strtotime($this->fecha);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse value of [fecha] as date/time value: " . var_export($this->fecha, true));
			}
		} else {
			$ts = $this->fecha;
		}
		if ($format === null) {
			return $ts;
		} elseif (strpos($format, '%') !== false) {
			return strftime($format, $ts);
		} else {
			return date($format, $ts);
		}
	}

	
	public function getElaboradopor()
	{

		return $this->elaboradopor;
	}

	
	public function getCedula()
	{

		return $this->cedula;
	}

	
	public function setId($v)
	{

						if ($v !== null && !is_int($v) && is_numeric($v)) {
			$v = (int) $v;
		}

		if ($this->id !== $v) {
			$this->id = $v;
			$this->modifiedColumns[] = HistoriaPeer::ID;
		}

	} 
	
	public function setNumhistoria($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->numhistoria !== $v) {
			$this->numhistoria = $v;
			$this->modifiedColumns[] = HistoriaPeer::NUMHISTORIA;
		}

	} 
	
	public function setFecha($v)
	{

		if ($v !== null && !is_int($v)) {
			$ts = strtotime($v);
			if ($ts === -1 || $ts === false) { 				throw new PropelException("Unable to parse date/time value for [fecha] from input: " . var_export($v, true));
			}
		} else {
			$ts = $v;
		}
		if ($this->fecha !== $ts) {
			$this->fecha = $ts;
			$this->modifiedColumns[] = HistoriaPeer::FECHA;
		}

	} 
	
	public function setElaboradopor($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->elaboradopor !== $v) {
			$this->elaboradopor = $v;
			$this->modifiedColumns[] = HistoriaPeer::ELABORADOPOR;
		}

	} 
	
	public function setCedula($v)
	{

						if ($v !== null && !is_string($v)) {
			$v = (string) $v; 
		}

		if ($this->cedula !== $v) {
			$this->cedula = $v;
			$this->modifiedColumns[] = HistoriaPeer::CEDULA;
		}

		if ($this->aDatos !== null && $this->aDatos->getCedula() !== $v) {
			$this->aDatos = null;
		}

	} 
	
	public function hydrate(ResultSet $rs, $startcol = 1)
	{
		try {

			$this->id = $rs->getInt($startcol + 0);

			$this->numhistoria = $rs->getString($startcol + 1);

			$this->fecha = $rs->getDate($startcol + 2, null);

			$this->elaboradopor = $rs->getString($startcol + 3);

			$this->cedula = $rs->getString($startcol + 4);

			$this->resetModified();

			$this->setNew(false);

						return $startcol + 5; 
		} catch (Exception $e) {
			throw new PropelException("Error populating Historia object", $e);
		}
	}

	
	public function delete($con = null)
	{
		if ($this->isDeleted()) {
			throw new PropelException("This object has already been deleted.");
		}

		if ($con === null) {
			$con = Propel::getConnection(HistoriaPeer::DATABASE_NAME);
		}

		try {
			$con->begin();
			HistoriaPeer::doDelete($this, $con);
			$this->setDeleted(true);
			$con->commit();
		} catch (PropelException $e) {
			$con->rollback();
			throw $e;
		}
	}

	
	public function save($con = null)
	{
		if ($this->isDeleted()) {
			throw new PropelException("You cannot save an object that has been deleted.");
		}

		if ($con === null) {
			$con = Propel::getConnection(HistoriaPeer::DATABASE_NAME);
		}

		try {
			$con->begin();
			$affectedRows = $this->doSave($con);
			$con->commit();
			return $affectedRows;
		} catch (PropelException $e) {
			$con->rollback();
			throw $e;
		}
	}

	
	protected function doSave($con)
	{
		$affectedRows = 0; 		if (!$this->alreadyInSave) {
			$this->alreadyInSave = true;


												
			if ($this->aDatos !== null) {
				if ($this->aDatos->isModified()) {
					$affectedRows += $this->aDatos->save($con);
				}
				$this->setDatos($this->aDatos);
			}


						if ($this->isModified()) {
				if ($this->isNew()) {
					$pk = HistoriaPeer::doInsert($this, $con);
					$affectedRows += 1; 										 										 
					$this->setId($pk);  
					$this->setNew(false);
				} else {
					$affectedRows += HistoriaPeer::doUpdate($this, $con);
				}
				$this->resetModified(); 			}

			if ($this->collTabacos !== null) {
				foreach($this->collTabacos as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collAlcohols !== null) {
				foreach($this->collAlcohols as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collFisicas !== null) {
				foreach($this->collFisicas as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collRecreativass !== null) {
				foreach($this->collRecreativass as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collFunc_familias !== null) {
				foreach($this->collFunc_familias as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collMujeress !== null) {
				foreach($this->collMujeress as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collHombress !== null) {
				foreach($this->collHombress as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collEnfermedadess !== null) {
				foreach($this->collEnfermedadess as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collAntecedentess !== null) {
				foreach($this->collAntecedentess as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collAntegineobss !== null) {
				foreach($this->collAntegineobss as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collExamfiss !== null) {
				foreach($this->collExamfiss as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collInfante_pers !== null) {
				foreach($this->collInfante_pers as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collAspec_saluds !== null) {
				foreach($this->collAspec_saluds as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collEnf_nins !== null) {
				foreach($this->collEnf_nins as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collAlimenNins !== null) {
				foreach($this->collAlimenNins as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collEntrevistas !== null) {
				foreach($this->collEntrevistas as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collServicioss !== null) {
				foreach($this->collServicioss as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collSitsocioecons !== null) {
				foreach($this->collSitsocioecons as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collSitviviendas !== null) {
				foreach($this->collSitviviendas as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			if ($this->collUbc_geograficas !== null) {
				foreach($this->collUbc_geograficas as $referrerFK) {
					if (!$referrerFK->isDeleted()) {
						$affectedRows += $referrerFK->save($con);
					}
				}
			}

			$this->alreadyInSave = false;
		}
		return $affectedRows;
	} 
	
	protected $validationFailures = array();

	
	public function getValidationFailures()
	{
		return $this->validationFailures;
	}

	
	public function validate($columns = null)
	{
		$res = $this->doValidate($columns);
		if ($res === true) {
			$this->validationFailures = array();
			return true;
		} else {
			$this->validationFailures = $res;
			return false;
		}
	}

	
	protected function doValidate($columns = null)
	{
		if (!$this->alreadyInValidation) {
			$this->alreadyInValidation = true;
			$retval = null;

			$failureMap = array();


												
			if ($this->aDatos !== null) {
				if (!$this->aDatos->validate($columns)) {
					$failureMap = array_merge($failureMap, $this->aDatos->getValidationFailures());
				}
			}


			if (($retval = HistoriaPeer::doValidate($this, $columns)) !== true) {
				$failureMap = array_merge($failureMap, $retval);
			}


				if ($this->collTabacos !== null) {
					foreach($this->collTabacos as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collAlcohols !== null) {
					foreach($this->collAlcohols as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collFisicas !== null) {
					foreach($this->collFisicas as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collRecreativass !== null) {
					foreach($this->collRecreativass as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collFunc_familias !== null) {
					foreach($this->collFunc_familias as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collMujeress !== null) {
					foreach($this->collMujeress as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collHombress !== null) {
					foreach($this->collHombress as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collEnfermedadess !== null) {
					foreach($this->collEnfermedadess as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collAntecedentess !== null) {
					foreach($this->collAntecedentess as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collAntegineobss !== null) {
					foreach($this->collAntegineobss as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collExamfiss !== null) {
					foreach($this->collExamfiss as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collInfante_pers !== null) {
					foreach($this->collInfante_pers as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collAspec_saluds !== null) {
					foreach($this->collAspec_saluds as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collEnf_nins !== null) {
					foreach($this->collEnf_nins as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collAlimenNins !== null) {
					foreach($this->collAlimenNins as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collEntrevistas !== null) {
					foreach($this->collEntrevistas as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collServicioss !== null) {
					foreach($this->collServicioss as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collSitsocioecons !== null) {
					foreach($this->collSitsocioecons as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collSitviviendas !== null) {
					foreach($this->collSitviviendas as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}

				if ($this->collUbc_geograficas !== null) {
					foreach($this->collUbc_geograficas as $referrerFK) {
						if (!$referrerFK->validate($columns)) {
							$failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
						}
					}
				}


			$this->alreadyInValidation = false;
		}

		return (!empty($failureMap) ? $failureMap : true);
	}

	
	public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
	{
		$pos = HistoriaPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
		return $this->getByPosition($pos);
	}

	
	public function getByPosition($pos)
	{
		switch($pos) {
			case 0:
				return $this->getId();
				break;
			case 1:
				return $this->getNumhistoria();
				break;
			case 2:
				return $this->getFecha();
				break;
			case 3:
				return $this->getElaboradopor();
				break;
			case 4:
				return $this->getCedula();
				break;
			default:
				return null;
				break;
		} 	}

	
	public function toArray($keyType = BasePeer::TYPE_PHPNAME)
	{
		$keys = HistoriaPeer::getFieldNames($keyType);
		$result = array(
			$keys[0] => $this->getId(),
			$keys[1] => $this->getNumhistoria(),
			$keys[2] => $this->getFecha(),
			$keys[3] => $this->getElaboradopor(),
			$keys[4] => $this->getCedula(),
		);
		return $result;
	}

	
	public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
	{
		$pos = HistoriaPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
		return $this->setByPosition($pos, $value);
	}

	
	public function setByPosition($pos, $value)
	{
		switch($pos) {
			case 0:
				$this->setId($value);
				break;
			case 1:
				$this->setNumhistoria($value);
				break;
			case 2:
				$this->setFecha($value);
				break;
			case 3:
				$this->setElaboradopor($value);
				break;
			case 4:
				$this->setCedula($value);
				break;
		} 	}

	
	public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
	{
		$keys = HistoriaPeer::getFieldNames($keyType);

		if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
		if (array_key_exists($keys[1], $arr)) $this->setNumhistoria($arr[$keys[1]]);
		if (array_key_exists($keys[2], $arr)) $this->setFecha($arr[$keys[2]]);
		if (array_key_exists($keys[3], $arr)) $this->setElaboradopor($arr[$keys[3]]);
		if (array_key_exists($keys[4], $arr)) $this->setCedula($arr[$keys[4]]);
	}

	
	public function buildCriteria()
	{
		$criteria = new Criteria(HistoriaPeer::DATABASE_NAME);

		if ($this->isColumnModified(HistoriaPeer::ID)) $criteria->add(HistoriaPeer::ID, $this->id);
		if ($this->isColumnModified(HistoriaPeer::NUMHISTORIA)) $criteria->add(HistoriaPeer::NUMHISTORIA, $this->numhistoria);
		if ($this->isColumnModified(HistoriaPeer::FECHA)) $criteria->add(HistoriaPeer::FECHA, $this->fecha);
		if ($this->isColumnModified(HistoriaPeer::ELABORADOPOR)) $criteria->add(HistoriaPeer::ELABORADOPOR, $this->elaboradopor);
		if ($this->isColumnModified(HistoriaPeer::CEDULA)) $criteria->add(HistoriaPeer::CEDULA, $this->cedula);

		return $criteria;
	}

	
	public function buildPkeyCriteria()
	{
		$criteria = new Criteria(HistoriaPeer::DATABASE_NAME);

		$criteria->add(HistoriaPeer::ID, $this->id);
		$criteria->add(HistoriaPeer::NUMHISTORIA, $this->numhistoria);

		return $criteria;
	}

	
	public function getPrimaryKey()
	{
		$pks = array();

		$pks[0] = $this->getId();

		$pks[1] = $this->getNumhistoria();

		return $pks;
	}

	
	public function setPrimaryKey($keys)
	{

		$this->setId($keys[0]);

		$this->setNumhistoria($keys[1]);

	}

	
	public function copyInto($copyObj, $deepCopy = false)
	{

		$copyObj->setFecha($this->fecha);

		$copyObj->setElaboradopor($this->elaboradopor);

		$copyObj->setCedula($this->cedula);


		if ($deepCopy) {
									$copyObj->setNew(false);

			foreach($this->getTabacos() as $relObj) {
				$copyObj->addTabaco($relObj->copy($deepCopy));
			}

			foreach($this->getAlcohols() as $relObj) {
				$copyObj->addAlcohol($relObj->copy($deepCopy));
			}

			foreach($this->getFisicas() as $relObj) {
				$copyObj->addFisica($relObj->copy($deepCopy));
			}

			foreach($this->getRecreativass() as $relObj) {
				$copyObj->addRecreativas($relObj->copy($deepCopy));
			}

			foreach($this->getFunc_familias() as $relObj) {
				$copyObj->addFunc_familia($relObj->copy($deepCopy));
			}

			foreach($this->getMujeress() as $relObj) {
				$copyObj->addMujeres($relObj->copy($deepCopy));
			}

			foreach($this->getHombress() as $relObj) {
				$copyObj->addHombres($relObj->copy($deepCopy));
			}

			foreach($this->getEnfermedadess() as $relObj) {
				$copyObj->addEnfermedades($relObj->copy($deepCopy));
			}

			foreach($this->getAntecedentess() as $relObj) {
				$copyObj->addAntecedentes($relObj->copy($deepCopy));
			}

			foreach($this->getAntegineobss() as $relObj) {
				$copyObj->addAntegineobs($relObj->copy($deepCopy));
			}

			foreach($this->getExamfiss() as $relObj) {
				$copyObj->addExamfis($relObj->copy($deepCopy));
			}

			foreach($this->getInfante_pers() as $relObj) {
				$copyObj->addInfante_per($relObj->copy($deepCopy));
			}

			foreach($this->getAspec_saluds() as $relObj) {
				$copyObj->addAspec_salud($relObj->copy($deepCopy));
			}

			foreach($this->getEnf_nins() as $relObj) {
				$copyObj->addEnf_nin($relObj->copy($deepCopy));
			}

			foreach($this->getAlimenNins() as $relObj) {
				$copyObj->addAlimenNin($relObj->copy($deepCopy));
			}

			foreach($this->getEntrevistas() as $relObj) {
				$copyObj->addEntrevista($relObj->copy($deepCopy));
			}

			foreach($this->getServicioss() as $relObj) {
				$copyObj->addServicios($relObj->copy($deepCopy));
			}

			foreach($this->getSitsocioecons() as $relObj) {
				$copyObj->addSitsocioecon($relObj->copy($deepCopy));
			}

			foreach($this->getSitviviendas() as $relObj) {
				$copyObj->addSitvivienda($relObj->copy($deepCopy));
			}

			foreach($this->getUbc_geograficas() as $relObj) {
				$copyObj->addUbc_geografica($relObj->copy($deepCopy));
			}

		} 

		$copyObj->setNew(true);

		$copyObj->setId(NULL); 
		$copyObj->setNumhistoria(NULL); 
	}

	
	public function copy($deepCopy = false)
	{
				$clazz = get_class($this);
		$copyObj = new $clazz();
		$this->copyInto($copyObj, $deepCopy);
		return $copyObj;
	}

	
	public function getPeer()
	{
		if (self::$peer === null) {
			self::$peer = new HistoriaPeer();
		}
		return self::$peer;
	}

	
	public function setDatos($v)
	{


		if ($v === null) {
			$this->setCedula(NULL);
		} else {
			$this->setCedula($v->getCedula());
		}


		$this->aDatos = $v;
	}


	
	public function getDatos($con = null)
	{
		if ($this->aDatos === null && (($this->cedula !== "" && $this->cedula !== null))) {
						$this->aDatos = DatosPeer::retrieveByPK($this->cedula, $con);

			
		}
		return $this->aDatos;
	}

	
	public function initTabacos()
	{
		if ($this->collTabacos === null) {
			$this->collTabacos = array();
		}
	}

	
	public function getTabacos($criteria = null, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collTabacos === null) {
			if ($this->isNew()) {
			   $this->collTabacos = array();
			} else {

				$criteria->add(TabacoPeer::NUMHISTORIA, $this->getNumhistoria());

				TabacoPeer::addSelectColumns($criteria);
				$this->collTabacos = TabacoPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(TabacoPeer::NUMHISTORIA, $this->getNumhistoria());

				TabacoPeer::addSelectColumns($criteria);
				if (!isset($this->lastTabacoCriteria) || !$this->lastTabacoCriteria->equals($criteria)) {
					$this->collTabacos = TabacoPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastTabacoCriteria = $criteria;
		return $this->collTabacos;
	}

	
	public function countTabacos($criteria = null, $distinct = false, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(TabacoPeer::NUMHISTORIA, $this->getNumhistoria());

		return TabacoPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addTabaco(Tabaco $l)
	{
		$this->collTabacos[] = $l;
		$l->setHistoria($this);
	}

	
	public function initAlcohols()
	{
		if ($this->collAlcohols === null) {
			$this->collAlcohols = array();
		}
	}

	
	public function getAlcohols($criteria = null, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collAlcohols === null) {
			if ($this->isNew()) {
			   $this->collAlcohols = array();
			} else {

				$criteria->add(AlcoholPeer::NUMHISTORIA, $this->getNumhistoria());

				AlcoholPeer::addSelectColumns($criteria);
				$this->collAlcohols = AlcoholPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(AlcoholPeer::NUMHISTORIA, $this->getNumhistoria());

				AlcoholPeer::addSelectColumns($criteria);
				if (!isset($this->lastAlcoholCriteria) || !$this->lastAlcoholCriteria->equals($criteria)) {
					$this->collAlcohols = AlcoholPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastAlcoholCriteria = $criteria;
		return $this->collAlcohols;
	}

	
	public function countAlcohols($criteria = null, $distinct = false, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(AlcoholPeer::NUMHISTORIA, $this->getNumhistoria());

		return AlcoholPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addAlcohol(Alcohol $l)
	{
		$this->collAlcohols[] = $l;
		$l->setHistoria($this);
	}

	
	public function initFisicas()
	{
		if ($this->collFisicas === null) {
			$this->collFisicas = array();
		}
	}

	
	public function getFisicas($criteria = null, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collFisicas === null) {
			if ($this->isNew()) {
			   $this->collFisicas = array();
			} else {

				$criteria->add(FisicaPeer::NUMHISTORIA, $this->getNumhistoria());

				FisicaPeer::addSelectColumns($criteria);
				$this->collFisicas = FisicaPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(FisicaPeer::NUMHISTORIA, $this->getNumhistoria());

				FisicaPeer::addSelectColumns($criteria);
				if (!isset($this->lastFisicaCriteria) || !$this->lastFisicaCriteria->equals($criteria)) {
					$this->collFisicas = FisicaPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastFisicaCriteria = $criteria;
		return $this->collFisicas;
	}

	
	public function countFisicas($criteria = null, $distinct = false, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(FisicaPeer::NUMHISTORIA, $this->getNumhistoria());

		return FisicaPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addFisica(Fisica $l)
	{
		$this->collFisicas[] = $l;
		$l->setHistoria($this);
	}

	
	public function initRecreativass()
	{
		if ($this->collRecreativass === null) {
			$this->collRecreativass = array();
		}
	}

	
	public function getRecreativass($criteria = null, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collRecreativass === null) {
			if ($this->isNew()) {
			   $this->collRecreativass = array();
			} else {

				$criteria->add(RecreativasPeer::NUMHISTORIA, $this->getNumhistoria());

				RecreativasPeer::addSelectColumns($criteria);
				$this->collRecreativass = RecreativasPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(RecreativasPeer::NUMHISTORIA, $this->getNumhistoria());

				RecreativasPeer::addSelectColumns($criteria);
				if (!isset($this->lastRecreativasCriteria) || !$this->lastRecreativasCriteria->equals($criteria)) {
					$this->collRecreativass = RecreativasPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastRecreativasCriteria = $criteria;
		return $this->collRecreativass;
	}

	
	public function countRecreativass($criteria = null, $distinct = false, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(RecreativasPeer::NUMHISTORIA, $this->getNumhistoria());

		return RecreativasPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addRecreativas(Recreativas $l)
	{
		$this->collRecreativass[] = $l;
		$l->setHistoria($this);
	}


	
	public function getRecreativassJoinActividades($criteria = null, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collRecreativass === null) {
			if ($this->isNew()) {
				$this->collRecreativass = array();
			} else {

				$criteria->add(RecreativasPeer::NUMHISTORIA, $this->getNumhistoria());

				$this->collRecreativass = RecreativasPeer::doSelectJoinActividades($criteria, $con);
			}
		} else {
									
			$criteria->add(RecreativasPeer::NUMHISTORIA, $this->getNumhistoria());

			if (!isset($this->lastRecreativasCriteria) || !$this->lastRecreativasCriteria->equals($criteria)) {
				$this->collRecreativass = RecreativasPeer::doSelectJoinActividades($criteria, $con);
			}
		}
		$this->lastRecreativasCriteria = $criteria;

		return $this->collRecreativass;
	}

	
	public function initFunc_familias()
	{
		if ($this->collFunc_familias === null) {
			$this->collFunc_familias = array();
		}
	}

	
	public function getFunc_familias($criteria = null, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collFunc_familias === null) {
			if ($this->isNew()) {
			   $this->collFunc_familias = array();
			} else {

				$criteria->add(Func_familiaPeer::NUMHISTORIA, $this->getNumhistoria());

				Func_familiaPeer::addSelectColumns($criteria);
				$this->collFunc_familias = Func_familiaPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(Func_familiaPeer::NUMHISTORIA, $this->getNumhistoria());

				Func_familiaPeer::addSelectColumns($criteria);
				if (!isset($this->lastFunc_familiaCriteria) || !$this->lastFunc_familiaCriteria->equals($criteria)) {
					$this->collFunc_familias = Func_familiaPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastFunc_familiaCriteria = $criteria;
		return $this->collFunc_familias;
	}

	
	public function countFunc_familias($criteria = null, $distinct = false, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(Func_familiaPeer::NUMHISTORIA, $this->getNumhistoria());

		return Func_familiaPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addFunc_familia(Func_familia $l)
	{
		$this->collFunc_familias[] = $l;
		$l->setHistoria($this);
	}


	
	public function getFunc_familiasJoinFrecuenciaRelatedByDesiciones($criteria = null, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collFunc_familias === null) {
			if ($this->isNew()) {
				$this->collFunc_familias = array();
			} else {

				$criteria->add(Func_familiaPeer::NUMHISTORIA, $this->getNumhistoria());

				$this->collFunc_familias = Func_familiaPeer::doSelectJoinFrecuenciaRelatedByDesiciones($criteria, $con);
			}
		} else {
									
			$criteria->add(Func_familiaPeer::NUMHISTORIA, $this->getNumhistoria());

			if (!isset($this->lastFunc_familiaCriteria) || !$this->lastFunc_familiaCriteria->equals($criteria)) {
				$this->collFunc_familias = Func_familiaPeer::doSelectJoinFrecuenciaRelatedByDesiciones($criteria, $con);
			}
		}
		$this->lastFunc_familiaCriteria = $criteria;

		return $this->collFunc_familias;
	}


	
	public function getFunc_familiasJoinFrecuenciaRelatedByDefectos($criteria = null, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collFunc_familias === null) {
			if ($this->isNew()) {
				$this->collFunc_familias = array();
			} else {

				$criteria->add(Func_familiaPeer::NUMHISTORIA, $this->getNumhistoria());

				$this->collFunc_familias = Func_familiaPeer::doSelectJoinFrecuenciaRelatedByDefectos($criteria, $con);
			}
		} else {
									
			$criteria->add(Func_familiaPeer::NUMHISTORIA, $this->getNumhistoria());

			if (!isset($this->lastFunc_familiaCriteria) || !$this->lastFunc_familiaCriteria->equals($criteria)) {
				$this->collFunc_familias = Func_familiaPeer::doSelectJoinFrecuenciaRelatedByDefectos($criteria, $con);
			}
		}
		$this->lastFunc_familiaCriteria = $criteria;

		return $this->collFunc_familias;
	}


	
	public function getFunc_familiasJoinFrecuenciaRelatedByAyudan($criteria = null, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collFunc_familias === null) {
			if ($this->isNew()) {
				$this->collFunc_familias = array();
			} else {

				$criteria->add(Func_familiaPeer::NUMHISTORIA, $this->getNumhistoria());

				$this->collFunc_familias = Func_familiaPeer::doSelectJoinFrecuenciaRelatedByAyudan($criteria, $con);
			}
		} else {
									
			$criteria->add(Func_familiaPeer::NUMHISTORIA, $this->getNumhistoria());

			if (!isset($this->lastFunc_familiaCriteria) || !$this->lastFunc_familiaCriteria->equals($criteria)) {
				$this->collFunc_familias = Func_familiaPeer::doSelectJoinFrecuenciaRelatedByAyudan($criteria, $con);
			}
		}
		$this->lastFunc_familiaCriteria = $criteria;

		return $this->collFunc_familias;
	}


	
	public function getFunc_familiasJoinFrecuenciaRelatedByArmonia($criteria = null, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collFunc_familias === null) {
			if ($this->isNew()) {
				$this->collFunc_familias = array();
			} else {

				$criteria->add(Func_familiaPeer::NUMHISTORIA, $this->getNumhistoria());

				$this->collFunc_familias = Func_familiaPeer::doSelectJoinFrecuenciaRelatedByArmonia($criteria, $con);
			}
		} else {
									
			$criteria->add(Func_familiaPeer::NUMHISTORIA, $this->getNumhistoria());

			if (!isset($this->lastFunc_familiaCriteria) || !$this->lastFunc_familiaCriteria->equals($criteria)) {
				$this->collFunc_familias = Func_familiaPeer::doSelectJoinFrecuenciaRelatedByArmonia($criteria, $con);
			}
		}
		$this->lastFunc_familiaCriteria = $criteria;

		return $this->collFunc_familias;
	}


	
	public function getFunc_familiasJoinFrecuenciaRelatedByResponsa($criteria = null, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collFunc_familias === null) {
			if ($this->isNew()) {
				$this->collFunc_familias = array();
			} else {

				$criteria->add(Func_familiaPeer::NUMHISTORIA, $this->getNumhistoria());

				$this->collFunc_familias = Func_familiaPeer::doSelectJoinFrecuenciaRelatedByResponsa($criteria, $con);
			}
		} else {
									
			$criteria->add(Func_familiaPeer::NUMHISTORIA, $this->getNumhistoria());

			if (!isset($this->lastFunc_familiaCriteria) || !$this->lastFunc_familiaCriteria->equals($criteria)) {
				$this->collFunc_familias = Func_familiaPeer::doSelectJoinFrecuenciaRelatedByResponsa($criteria, $con);
			}
		}
		$this->lastFunc_familiaCriteria = $criteria;

		return $this->collFunc_familias;
	}


	
	public function getFunc_familiasJoinFrecuenciaRelatedByTareas($criteria = null, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collFunc_familias === null) {
			if ($this->isNew()) {
				$this->collFunc_familias = array();
			} else {

				$criteria->add(Func_familiaPeer::NUMHISTORIA, $this->getNumhistoria());

				$this->collFunc_familias = Func_familiaPeer::doSelectJoinFrecuenciaRelatedByTareas($criteria, $con);
			}
		} else {
									
			$criteria->add(Func_familiaPeer::NUMHISTORIA, $this->getNumhistoria());

			if (!isset($this->lastFunc_familiaCriteria) || !$this->lastFunc_familiaCriteria->equals($criteria)) {
				$this->collFunc_familias = Func_familiaPeer::doSelectJoinFrecuenciaRelatedByTareas($criteria, $con);
			}
		}
		$this->lastFunc_familiaCriteria = $criteria;

		return $this->collFunc_familias;
	}


	
	public function getFunc_familiasJoinFrecuenciaRelatedByTemas($criteria = null, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collFunc_familias === null) {
			if ($this->isNew()) {
				$this->collFunc_familias = array();
			} else {

				$criteria->add(Func_familiaPeer::NUMHISTORIA, $this->getNumhistoria());

				$this->collFunc_familias = Func_familiaPeer::doSelectJoinFrecuenciaRelatedByTemas($criteria, $con);
			}
		} else {
									
			$criteria->add(Func_familiaPeer::NUMHISTORIA, $this->getNumhistoria());

			if (!isset($this->lastFunc_familiaCriteria) || !$this->lastFunc_familiaCriteria->equals($criteria)) {
				$this->collFunc_familias = Func_familiaPeer::doSelectJoinFrecuenciaRelatedByTemas($criteria, $con);
			}
		}
		$this->lastFunc_familiaCriteria = $criteria;

		return $this->collFunc_familias;
	}

	
	public function initMujeress()
	{
		if ($this->collMujeress === null) {
			$this->collMujeress = array();
		}
	}

	
	public function getMujeress($criteria = null, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collMujeress === null) {
			if ($this->isNew()) {
			   $this->collMujeress = array();
			} else {

				$criteria->add(MujeresPeer::NUMHISTORIA, $this->getNumhistoria());

				MujeresPeer::addSelectColumns($criteria);
				$this->collMujeress = MujeresPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(MujeresPeer::NUMHISTORIA, $this->getNumhistoria());

				MujeresPeer::addSelectColumns($criteria);
				if (!isset($this->lastMujeresCriteria) || !$this->lastMujeresCriteria->equals($criteria)) {
					$this->collMujeress = MujeresPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastMujeresCriteria = $criteria;
		return $this->collMujeress;
	}

	
	public function countMujeress($criteria = null, $distinct = false, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(MujeresPeer::NUMHISTORIA, $this->getNumhistoria());

		return MujeresPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addMujeres(Mujeres $l)
	{
		$this->collMujeress[] = $l;
		$l->setHistoria($this);
	}

	
	public function initHombress()
	{
		if ($this->collHombress === null) {
			$this->collHombress = array();
		}
	}

	
	public function getHombress($criteria = null, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collHombress === null) {
			if ($this->isNew()) {
			   $this->collHombress = array();
			} else {

				$criteria->add(HombresPeer::NUMHISTORIA, $this->getNumhistoria());

				HombresPeer::addSelectColumns($criteria);
				$this->collHombress = HombresPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(HombresPeer::NUMHISTORIA, $this->getNumhistoria());

				HombresPeer::addSelectColumns($criteria);
				if (!isset($this->lastHombresCriteria) || !$this->lastHombresCriteria->equals($criteria)) {
					$this->collHombress = HombresPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastHombresCriteria = $criteria;
		return $this->collHombress;
	}

	
	public function countHombress($criteria = null, $distinct = false, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(HombresPeer::NUMHISTORIA, $this->getNumhistoria());

		return HombresPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addHombres(Hombres $l)
	{
		$this->collHombress[] = $l;
		$l->setHistoria($this);
	}

	
	public function initEnfermedadess()
	{
		if ($this->collEnfermedadess === null) {
			$this->collEnfermedadess = array();
		}
	}

	
	public function getEnfermedadess($criteria = null, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collEnfermedadess === null) {
			if ($this->isNew()) {
			   $this->collEnfermedadess = array();
			} else {

				$criteria->add(EnfermedadesPeer::NUMHISTORIA, $this->getNumhistoria());

				EnfermedadesPeer::addSelectColumns($criteria);
				$this->collEnfermedadess = EnfermedadesPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(EnfermedadesPeer::NUMHISTORIA, $this->getNumhistoria());

				EnfermedadesPeer::addSelectColumns($criteria);
				if (!isset($this->lastEnfermedadesCriteria) || !$this->lastEnfermedadesCriteria->equals($criteria)) {
					$this->collEnfermedadess = EnfermedadesPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastEnfermedadesCriteria = $criteria;
		return $this->collEnfermedadess;
	}

	
	public function countEnfermedadess($criteria = null, $distinct = false, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(EnfermedadesPeer::NUMHISTORIA, $this->getNumhistoria());

		return EnfermedadesPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addEnfermedades(Enfermedades $l)
	{
		$this->collEnfermedadess[] = $l;
		$l->setHistoria($this);
	}


	
	public function getEnfermedadessJoinTipo_enf($criteria = null, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collEnfermedadess === null) {
			if ($this->isNew()) {
				$this->collEnfermedadess = array();
			} else {

				$criteria->add(EnfermedadesPeer::NUMHISTORIA, $this->getNumhistoria());

				$this->collEnfermedadess = EnfermedadesPeer::doSelectJoinTipo_enf($criteria, $con);
			}
		} else {
									
			$criteria->add(EnfermedadesPeer::NUMHISTORIA, $this->getNumhistoria());

			if (!isset($this->lastEnfermedadesCriteria) || !$this->lastEnfermedadesCriteria->equals($criteria)) {
				$this->collEnfermedadess = EnfermedadesPeer::doSelectJoinTipo_enf($criteria, $con);
			}
		}
		$this->lastEnfermedadesCriteria = $criteria;

		return $this->collEnfermedadess;
	}

	
	public function initAntecedentess()
	{
		if ($this->collAntecedentess === null) {
			$this->collAntecedentess = array();
		}
	}

	
	public function getAntecedentess($criteria = null, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collAntecedentess === null) {
			if ($this->isNew()) {
			   $this->collAntecedentess = array();
			} else {

				$criteria->add(AntecedentesPeer::NUMHISTORIA, $this->getNumhistoria());

				AntecedentesPeer::addSelectColumns($criteria);
				$this->collAntecedentess = AntecedentesPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(AntecedentesPeer::NUMHISTORIA, $this->getNumhistoria());

				AntecedentesPeer::addSelectColumns($criteria);
				if (!isset($this->lastAntecedentesCriteria) || !$this->lastAntecedentesCriteria->equals($criteria)) {
					$this->collAntecedentess = AntecedentesPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastAntecedentesCriteria = $criteria;
		return $this->collAntecedentess;
	}

	
	public function countAntecedentess($criteria = null, $distinct = false, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(AntecedentesPeer::NUMHISTORIA, $this->getNumhistoria());

		return AntecedentesPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addAntecedentes(Antecedentes $l)
	{
		$this->collAntecedentess[] = $l;
		$l->setHistoria($this);
	}


	
	public function getAntecedentessJoinTip_antecede($criteria = null, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collAntecedentess === null) {
			if ($this->isNew()) {
				$this->collAntecedentess = array();
			} else {

				$criteria->add(AntecedentesPeer::NUMHISTORIA, $this->getNumhistoria());

				$this->collAntecedentess = AntecedentesPeer::doSelectJoinTip_antecede($criteria, $con);
			}
		} else {
									
			$criteria->add(AntecedentesPeer::NUMHISTORIA, $this->getNumhistoria());

			if (!isset($this->lastAntecedentesCriteria) || !$this->lastAntecedentesCriteria->equals($criteria)) {
				$this->collAntecedentess = AntecedentesPeer::doSelectJoinTip_antecede($criteria, $con);
			}
		}
		$this->lastAntecedentesCriteria = $criteria;

		return $this->collAntecedentess;
	}

	
	public function initAntegineobss()
	{
		if ($this->collAntegineobss === null) {
			$this->collAntegineobss = array();
		}
	}

	
	public function getAntegineobss($criteria = null, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collAntegineobss === null) {
			if ($this->isNew()) {
			   $this->collAntegineobss = array();
			} else {

				$criteria->add(AntegineobsPeer::NUMHISTORIA, $this->getNumhistoria());

				AntegineobsPeer::addSelectColumns($criteria);
				$this->collAntegineobss = AntegineobsPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(AntegineobsPeer::NUMHISTORIA, $this->getNumhistoria());

				AntegineobsPeer::addSelectColumns($criteria);
				if (!isset($this->lastAntegineobsCriteria) || !$this->lastAntegineobsCriteria->equals($criteria)) {
					$this->collAntegineobss = AntegineobsPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastAntegineobsCriteria = $criteria;
		return $this->collAntegineobss;
	}

	
	public function countAntegineobss($criteria = null, $distinct = false, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(AntegineobsPeer::NUMHISTORIA, $this->getNumhistoria());

		return AntegineobsPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addAntegineobs(Antegineobs $l)
	{
		$this->collAntegineobss[] = $l;
		$l->setHistoria($this);
	}

	
	public function initExamfiss()
	{
		if ($this->collExamfiss === null) {
			$this->collExamfiss = array();
		}
	}

	
	public function getExamfiss($criteria = null, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collExamfiss === null) {
			if ($this->isNew()) {
			   $this->collExamfiss = array();
			} else {

				$criteria->add(ExamfisPeer::NUMHISTORIA, $this->getNumhistoria());

				ExamfisPeer::addSelectColumns($criteria);
				$this->collExamfiss = ExamfisPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(ExamfisPeer::NUMHISTORIA, $this->getNumhistoria());

				ExamfisPeer::addSelectColumns($criteria);
				if (!isset($this->lastExamfisCriteria) || !$this->lastExamfisCriteria->equals($criteria)) {
					$this->collExamfiss = ExamfisPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastExamfisCriteria = $criteria;
		return $this->collExamfiss;
	}

	
	public function countExamfiss($criteria = null, $distinct = false, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(ExamfisPeer::NUMHISTORIA, $this->getNumhistoria());

		return ExamfisPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addExamfis(Examfis $l)
	{
		$this->collExamfiss[] = $l;
		$l->setHistoria($this);
	}

	
	public function initInfante_pers()
	{
		if ($this->collInfante_pers === null) {
			$this->collInfante_pers = array();
		}
	}

	
	public function getInfante_pers($criteria = null, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collInfante_pers === null) {
			if ($this->isNew()) {
			   $this->collInfante_pers = array();
			} else {

				$criteria->add(Infante_perPeer::NUMHISTORIA, $this->getNumhistoria());

				Infante_perPeer::addSelectColumns($criteria);
				$this->collInfante_pers = Infante_perPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(Infante_perPeer::NUMHISTORIA, $this->getNumhistoria());

				Infante_perPeer::addSelectColumns($criteria);
				if (!isset($this->lastInfante_perCriteria) || !$this->lastInfante_perCriteria->equals($criteria)) {
					$this->collInfante_pers = Infante_perPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastInfante_perCriteria = $criteria;
		return $this->collInfante_pers;
	}

	
	public function countInfante_pers($criteria = null, $distinct = false, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(Infante_perPeer::NUMHISTORIA, $this->getNumhistoria());

		return Infante_perPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addInfante_per(Infante_per $l)
	{
		$this->collInfante_pers[] = $l;
		$l->setHistoria($this);
	}


	
	public function getInfante_persJoinDatos($criteria = null, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collInfante_pers === null) {
			if ($this->isNew()) {
				$this->collInfante_pers = array();
			} else {

				$criteria->add(Infante_perPeer::NUMHISTORIA, $this->getNumhistoria());

				$this->collInfante_pers = Infante_perPeer::doSelectJoinDatos($criteria, $con);
			}
		} else {
									
			$criteria->add(Infante_perPeer::NUMHISTORIA, $this->getNumhistoria());

			if (!isset($this->lastInfante_perCriteria) || !$this->lastInfante_perCriteria->equals($criteria)) {
				$this->collInfante_pers = Infante_perPeer::doSelectJoinDatos($criteria, $con);
			}
		}
		$this->lastInfante_perCriteria = $criteria;

		return $this->collInfante_pers;
	}

	
	public function initAspec_saluds()
	{
		if ($this->collAspec_saluds === null) {
			$this->collAspec_saluds = array();
		}
	}

	
	public function getAspec_saluds($criteria = null, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collAspec_saluds === null) {
			if ($this->isNew()) {
			   $this->collAspec_saluds = array();
			} else {

				$criteria->add(Aspec_saludPeer::NUMHISTORIA, $this->getNumhistoria());

				Aspec_saludPeer::addSelectColumns($criteria);
				$this->collAspec_saluds = Aspec_saludPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(Aspec_saludPeer::NUMHISTORIA, $this->getNumhistoria());

				Aspec_saludPeer::addSelectColumns($criteria);
				if (!isset($this->lastAspec_saludCriteria) || !$this->lastAspec_saludCriteria->equals($criteria)) {
					$this->collAspec_saluds = Aspec_saludPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastAspec_saludCriteria = $criteria;
		return $this->collAspec_saluds;
	}

	
	public function countAspec_saluds($criteria = null, $distinct = false, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(Aspec_saludPeer::NUMHISTORIA, $this->getNumhistoria());

		return Aspec_saludPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addAspec_salud(Aspec_salud $l)
	{
		$this->collAspec_saluds[] = $l;
		$l->setHistoria($this);
	}

	
	public function initEnf_nins()
	{
		if ($this->collEnf_nins === null) {
			$this->collEnf_nins = array();
		}
	}

	
	public function getEnf_nins($criteria = null, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collEnf_nins === null) {
			if ($this->isNew()) {
			   $this->collEnf_nins = array();
			} else {

				$criteria->add(Enf_ninPeer::NUMHISTORIA, $this->getNumhistoria());

				Enf_ninPeer::addSelectColumns($criteria);
				$this->collEnf_nins = Enf_ninPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(Enf_ninPeer::NUMHISTORIA, $this->getNumhistoria());

				Enf_ninPeer::addSelectColumns($criteria);
				if (!isset($this->lastEnf_ninCriteria) || !$this->lastEnf_ninCriteria->equals($criteria)) {
					$this->collEnf_nins = Enf_ninPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastEnf_ninCriteria = $criteria;
		return $this->collEnf_nins;
	}

	
	public function countEnf_nins($criteria = null, $distinct = false, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(Enf_ninPeer::NUMHISTORIA, $this->getNumhistoria());

		return Enf_ninPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addEnf_nin(Enf_nin $l)
	{
		$this->collEnf_nins[] = $l;
		$l->setHistoria($this);
	}

	
	public function initAlimenNins()
	{
		if ($this->collAlimenNins === null) {
			$this->collAlimenNins = array();
		}
	}

	
	public function getAlimenNins($criteria = null, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collAlimenNins === null) {
			if ($this->isNew()) {
			   $this->collAlimenNins = array();
			} else {

				$criteria->add(AlimenNinPeer::NUMHISTORIA, $this->getNumhistoria());

				AlimenNinPeer::addSelectColumns($criteria);
				$this->collAlimenNins = AlimenNinPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(AlimenNinPeer::NUMHISTORIA, $this->getNumhistoria());

				AlimenNinPeer::addSelectColumns($criteria);
				if (!isset($this->lastAlimenNinCriteria) || !$this->lastAlimenNinCriteria->equals($criteria)) {
					$this->collAlimenNins = AlimenNinPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastAlimenNinCriteria = $criteria;
		return $this->collAlimenNins;
	}

	
	public function countAlimenNins($criteria = null, $distinct = false, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(AlimenNinPeer::NUMHISTORIA, $this->getNumhistoria());

		return AlimenNinPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addAlimenNin(AlimenNin $l)
	{
		$this->collAlimenNins[] = $l;
		$l->setHistoria($this);
	}

	
	public function initEntrevistas()
	{
		if ($this->collEntrevistas === null) {
			$this->collEntrevistas = array();
		}
	}

	
	public function getEntrevistas($criteria = null, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collEntrevistas === null) {
			if ($this->isNew()) {
			   $this->collEntrevistas = array();
			} else {

				$criteria->add(EntrevistaPeer::NUMHISTORIA, $this->getNumhistoria());

				EntrevistaPeer::addSelectColumns($criteria);
				$this->collEntrevistas = EntrevistaPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(EntrevistaPeer::NUMHISTORIA, $this->getNumhistoria());

				EntrevistaPeer::addSelectColumns($criteria);
				if (!isset($this->lastEntrevistaCriteria) || !$this->lastEntrevistaCriteria->equals($criteria)) {
					$this->collEntrevistas = EntrevistaPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastEntrevistaCriteria = $criteria;
		return $this->collEntrevistas;
	}

	
	public function countEntrevistas($criteria = null, $distinct = false, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(EntrevistaPeer::NUMHISTORIA, $this->getNumhistoria());

		return EntrevistaPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addEntrevista(Entrevista $l)
	{
		$this->collEntrevistas[] = $l;
		$l->setHistoria($this);
	}

	
	public function initServicioss()
	{
		if ($this->collServicioss === null) {
			$this->collServicioss = array();
		}
	}

	
	public function getServicioss($criteria = null, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collServicioss === null) {
			if ($this->isNew()) {
			   $this->collServicioss = array();
			} else {

				$criteria->add(ServiciosPeer::NUMHISTORIA, $this->getNumhistoria());

				ServiciosPeer::addSelectColumns($criteria);
				$this->collServicioss = ServiciosPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(ServiciosPeer::NUMHISTORIA, $this->getNumhistoria());

				ServiciosPeer::addSelectColumns($criteria);
				if (!isset($this->lastServiciosCriteria) || !$this->lastServiciosCriteria->equals($criteria)) {
					$this->collServicioss = ServiciosPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastServiciosCriteria = $criteria;
		return $this->collServicioss;
	}

	
	public function countServicioss($criteria = null, $distinct = false, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(ServiciosPeer::NUMHISTORIA, $this->getNumhistoria());

		return ServiciosPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addServicios(Servicios $l)
	{
		$this->collServicioss[] = $l;
		$l->setHistoria($this);
	}


	
	public function getServiciossJoinTipo_servRelatedByAguapotable($criteria = null, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collServicioss === null) {
			if ($this->isNew()) {
				$this->collServicioss = array();
			} else {

				$criteria->add(ServiciosPeer::NUMHISTORIA, $this->getNumhistoria());

				$this->collServicioss = ServiciosPeer::doSelectJoinTipo_servRelatedByAguapotable($criteria, $con);
			}
		} else {
									
			$criteria->add(ServiciosPeer::NUMHISTORIA, $this->getNumhistoria());

			if (!isset($this->lastServiciosCriteria) || !$this->lastServiciosCriteria->equals($criteria)) {
				$this->collServicioss = ServiciosPeer::doSelectJoinTipo_servRelatedByAguapotable($criteria, $con);
			}
		}
		$this->lastServiciosCriteria = $criteria;

		return $this->collServicioss;
	}


	
	public function getServiciossJoinTipo_servRelatedByDispoexcretas($criteria = null, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collServicioss === null) {
			if ($this->isNew()) {
				$this->collServicioss = array();
			} else {

				$criteria->add(ServiciosPeer::NUMHISTORIA, $this->getNumhistoria());

				$this->collServicioss = ServiciosPeer::doSelectJoinTipo_servRelatedByDispoexcretas($criteria, $con);
			}
		} else {
									
			$criteria->add(ServiciosPeer::NUMHISTORIA, $this->getNumhistoria());

			if (!isset($this->lastServiciosCriteria) || !$this->lastServiciosCriteria->equals($criteria)) {
				$this->collServicioss = ServiciosPeer::doSelectJoinTipo_servRelatedByDispoexcretas($criteria, $con);
			}
		}
		$this->lastServiciosCriteria = $criteria;

		return $this->collServicioss;
	}


	
	public function getServiciossJoinTipo_servRelatedByDispobasura($criteria = null, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collServicioss === null) {
			if ($this->isNew()) {
				$this->collServicioss = array();
			} else {

				$criteria->add(ServiciosPeer::NUMHISTORIA, $this->getNumhistoria());

				$this->collServicioss = ServiciosPeer::doSelectJoinTipo_servRelatedByDispobasura($criteria, $con);
			}
		} else {
									
			$criteria->add(ServiciosPeer::NUMHISTORIA, $this->getNumhistoria());

			if (!isset($this->lastServiciosCriteria) || !$this->lastServiciosCriteria->equals($criteria)) {
				$this->collServicioss = ServiciosPeer::doSelectJoinTipo_servRelatedByDispobasura($criteria, $con);
			}
		}
		$this->lastServiciosCriteria = $criteria;

		return $this->collServicioss;
	}


	
	public function getServiciossJoinTipo_servRelatedByTransporte($criteria = null, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collServicioss === null) {
			if ($this->isNew()) {
				$this->collServicioss = array();
			} else {

				$criteria->add(ServiciosPeer::NUMHISTORIA, $this->getNumhistoria());

				$this->collServicioss = ServiciosPeer::doSelectJoinTipo_servRelatedByTransporte($criteria, $con);
			}
		} else {
									
			$criteria->add(ServiciosPeer::NUMHISTORIA, $this->getNumhistoria());

			if (!isset($this->lastServiciosCriteria) || !$this->lastServiciosCriteria->equals($criteria)) {
				$this->collServicioss = ServiciosPeer::doSelectJoinTipo_servRelatedByTransporte($criteria, $con);
			}
		}
		$this->lastServiciosCriteria = $criteria;

		return $this->collServicioss;
	}

	
	public function initSitsocioecons()
	{
		if ($this->collSitsocioecons === null) {
			$this->collSitsocioecons = array();
		}
	}

	
	public function getSitsocioecons($criteria = null, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collSitsocioecons === null) {
			if ($this->isNew()) {
			   $this->collSitsocioecons = array();
			} else {

				$criteria->add(SitsocioeconPeer::NUMHISTORIA, $this->getNumhistoria());

				SitsocioeconPeer::addSelectColumns($criteria);
				$this->collSitsocioecons = SitsocioeconPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(SitsocioeconPeer::NUMHISTORIA, $this->getNumhistoria());

				SitsocioeconPeer::addSelectColumns($criteria);
				if (!isset($this->lastSitsocioeconCriteria) || !$this->lastSitsocioeconCriteria->equals($criteria)) {
					$this->collSitsocioecons = SitsocioeconPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastSitsocioeconCriteria = $criteria;
		return $this->collSitsocioecons;
	}

	
	public function countSitsocioecons($criteria = null, $distinct = false, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(SitsocioeconPeer::NUMHISTORIA, $this->getNumhistoria());

		return SitsocioeconPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addSitsocioecon(Sitsocioecon $l)
	{
		$this->collSitsocioecons[] = $l;
		$l->setHistoria($this);
	}

	
	public function initSitviviendas()
	{
		if ($this->collSitviviendas === null) {
			$this->collSitviviendas = array();
		}
	}

	
	public function getSitviviendas($criteria = null, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collSitviviendas === null) {
			if ($this->isNew()) {
			   $this->collSitviviendas = array();
			} else {

				$criteria->add(SitviviendaPeer::NUMHISTORIA, $this->getNumhistoria());

				SitviviendaPeer::addSelectColumns($criteria);
				$this->collSitviviendas = SitviviendaPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(SitviviendaPeer::NUMHISTORIA, $this->getNumhistoria());

				SitviviendaPeer::addSelectColumns($criteria);
				if (!isset($this->lastSitviviendaCriteria) || !$this->lastSitviviendaCriteria->equals($criteria)) {
					$this->collSitviviendas = SitviviendaPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastSitviviendaCriteria = $criteria;
		return $this->collSitviviendas;
	}

	
	public function countSitviviendas($criteria = null, $distinct = false, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(SitviviendaPeer::NUMHISTORIA, $this->getNumhistoria());

		return SitviviendaPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addSitvivienda(Sitvivienda $l)
	{
		$this->collSitviviendas[] = $l;
		$l->setHistoria($this);
	}

	
	public function initUbc_geograficas()
	{
		if ($this->collUbc_geograficas === null) {
			$this->collUbc_geograficas = array();
		}
	}

	
	public function getUbc_geograficas($criteria = null, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		if ($this->collUbc_geograficas === null) {
			if ($this->isNew()) {
			   $this->collUbc_geograficas = array();
			} else {

				$criteria->add(Ubc_geograficaPeer::NUMHISTORIA, $this->getNumhistoria());

				Ubc_geograficaPeer::addSelectColumns($criteria);
				$this->collUbc_geograficas = Ubc_geograficaPeer::doSelect($criteria, $con);
			}
		} else {
						if (!$this->isNew()) {
												

				$criteria->add(Ubc_geograficaPeer::NUMHISTORIA, $this->getNumhistoria());

				Ubc_geograficaPeer::addSelectColumns($criteria);
				if (!isset($this->lastUbc_geograficaCriteria) || !$this->lastUbc_geograficaCriteria->equals($criteria)) {
					$this->collUbc_geograficas = Ubc_geograficaPeer::doSelect($criteria, $con);
				}
			}
		}
		$this->lastUbc_geograficaCriteria = $criteria;
		return $this->collUbc_geograficas;
	}

	
	public function countUbc_geograficas($criteria = null, $distinct = false, $con = null)
	{
				if ($criteria === null) {
			$criteria = new Criteria();
		}
		elseif ($criteria instanceof Criteria)
		{
			$criteria = clone $criteria;
		}

		$criteria->add(Ubc_geograficaPeer::NUMHISTORIA, $this->getNumhistoria());

		return Ubc_geograficaPeer::doCount($criteria, $distinct, $con);
	}

	
	public function addUbc_geografica(Ubc_geografica $l)
	{
		$this->collUbc_geograficas[] = $l;
		$l->setHistoria($this);
	}

} 